<?php
/*
###########################################################################
#                                  KALMAR                                 #
#                      http://akkar.sourceforge.net/                      #
#                                                                         #
#                            -------------------                          #
#                               visrolle.php                              #
#                            -------------------                          #
#                                                                         #
#   copyright (C) 2004 Roy W. Andersen                                    #
#   email: ensnared@gmail.com                                             #
#                                                                         #
###########################################################################

###########################################################################
#                                                                         #
#  This program is free software; you can redistribute it and/or modify   #
#  it under the terms of the GNU General Public License as published by   #
#  the Free Software Foundation; either version 2 of the License, or      #
#  (at your option) any later version.                                    #
#                                                                         #
###########################################################################
*/
define('IN_KALMAR', true);
include('common.php');

$rolle_id = $_REQUEST['rolle_id'];

if (($config['kalmar_paranoid'] == 1) && !is_related($rolle_id, $spill_id)) {
	exit('Access violation.');
}

if ($_POST['edited']) {
	oppdater_rolle();
	$_SESSION['message'] = $LANG['MESSAGE']['character_updated'];
	header('Location: ./visrolle.php?rolle_id='.$_POST['rolle_id'].'&spill_id='.$_POST['spill_id']);
	exit();
}


if (!$spill_id && !$rolle_id) {
	exit($LANG['ERROR']['no_char_or_game_selected']);
}
include('header.php');
echo character_sheet($rolle_id, $spill_id);

include('footer.php');
?>